
   year = "2008" 
   year = "2009" 
   year = "2010" 

   emis_type = "oc" 
   emis_type = "so2" 
   emis_type = "num_a1" 
   emis_type = "bc" 

   l_cam5 = True 
   l_cam5 = False

   if(emis_type.eq."bc") then 
      if(l_cam5) then 
         fna = "${input}/atm/cam/chem/trop_mozart_aero/emis/ar5_mam3_bc_elev_2000_c090726.nc" 
      else
         fna = "emis_GFED3.1_monthly_BC_"+year+"_2x2.5.nc" 
      end if 
   end if 

   if(emis_type.eq."oc") then 
      if(l_cam5) then 
         fna = "${input}/atm/cam/chem/trop_mozart_aero/emis/ar5_mam3_oc_elev_2000_c090726.nc" 
      else
         fna = "emis_GFED3.1_monthly_OC_"+year+"_2x2.5.nc" 
      end if 
   end if 

   if(emis_type.eq."so2") then
      if(l_cam5) then
         fna = "${input}/atm/cam/chem/trop_mozart_aero/emis/ar5_mam3_so2_elev_2000_c090726.nc"
      else
         fna = "emis_GFED3.1_monthly_so2_"+year+"_2x2.5.nc"
      end if
   end if

   if(emis_type.eq."num_a1") then
      if(l_cam5) then
         fna = "${input}/atm/cam/chem/trop_mozart_aero/emis/ar5_mam3_num_a1_elev_2000_c090726.nc"
      else
         fna = "emis_GFED3.1_monthly_num_a1_"+year+"_2x2.5.nc"
      end if
   end if

   fng = "gridarea.nc" 

   fla = addfile(fna,"r") 
   flg = addfile(fng,"r") 
  
   if(l_cam5) then  
      if(emis_type.eq."num_a1") then 
         emia = fla->BC_forestfire
         emib = fla->BC_grassfire
         emic = fla->OC_forestfire
         emid = fla->OC_grassfire
         emie = fla->SO4_forestfire
         emif = fla->SO4_grassfire
         emis = emia
         emis = emia + emib + emic + emid + emie + emif 
         emis = emis * 1.e-12
      else
         emia = fla->forestfire
         emib = fla->grassfire
         emis = emia
         emis = emia + emib 
      end if
   else 
      if(emis_type.eq."bc") then 
         emis = fla->BC_fire 
      end if 
      if(emis_type.eq."oc") then 
         emis = fla->OC_fire 
      end if 
      if(emis_type.eq."so2") then 
         emis = fla->SO2_fire 
      end if 
      if(emis_type.eq."num_a1") then 
         emia = fla->BC_fire 
         emib = fla->OC_fire 
         emic = fla->SO4_fire 
         emis = emia
         emis = emia + emib + emic 
         emis = emis * 1.e-12
      end if
   end if 

   area = flg->cell_area 

  
   nlon = dimsizes(emis(0,0,0,:)) 
   nlat = dimsizes(emis(0,0,:,0)) 
   nlev = dimsizes(emis(0,:,0,0)) 
   nt   = dimsizes(emis(:,0,0,0)) 

   do it = 0,nt-1 
   do ik = 0,nlev-1 
      emis(it,ik,:,:) = emis(it,ik,:,:) * area(:,:) 
   end do 
   end do 

   vs_emis = emis(:,0,:,:) 

   do it = 0,nt-1 
   do ik = 0,nlev-1 
      vs_emis(it,:,:) = vs_emis(it,:,:) + emis(it,ik,:,:)
   end do 
   end do 

   print(" sum(emis) : " + sum(dim_avg(vs_emis(lat|:,lon|:,time|:))) ) 

 

 
